// @APIVersion 1.0.0
// @Title beego Test API
// @Description beego has a very cool tools to autogenerate documents for your API
// @Contact astaxie@gmail.com
// @TermsOfServiceUrl http://beego.me/
// @License Apache 2.0
// @LicenseUrl http://www.apache.org/licenses/LICENSE-2.0.html
package routers

import (
	"github.com/astaxie/beego"
	"individual/controllers"
	"individual/controllers/background"
	"individual/controllers/frontdesk"
)

func init() {

	beego.Get("/login", frontdesk.Login)
	beego.Get("/getTokenByCode", frontdesk.GetTokenByCode)

	frontDesk := beego.NewNamespace("/frontDesk",
		beego.NSNamespace("/user",
			beego.NSInclude(
				&frontdesk.UserController{},
			),
		),
		beego.NSNamespace("/blog",
			beego.NSInclude(
				&frontdesk.BlogController{},
			),
		),
		beego.NSNamespace("/link",
			beego.NSInclude(
				&frontdesk.LinkController{},
			),
		),
		beego.NSNamespace("/leave_word",
			beego.NSInclude(
				&frontdesk.LeaveWordController{},
			),
		),
	)
	backGround := beego.NewNamespace("/background",
		beego.NSNamespace("/user",
			beego.NSInclude(
				&background.UserController{},
			),
		),
		beego.NSNamespace("/blog",
			beego.NSInclude(
				&background.BlogController{},
			),
		),
		beego.NSNamespace("/link",
			beego.NSInclude(
				&background.LinkController{},
			),
		),
		beego.NSNamespace("/leave_word",
			beego.NSInclude(
				&background.LeaveWordController{},
			),
		),
	)
	utils := beego.NewNamespace("/utils",
		beego.NSNamespace("/tencent_cloud_cos",
			beego.NSInclude(
				&controllers.TenCloudCosController{},
			),
		),
	)
	backGround.Filter("/*", frontdesk.FilterUser)
	beego.AddNamespace(frontDesk, backGround, utils)
}
